﻿<?php
	header("Content-Type:text/html;charset=utf-8");
	require "page.class.php";
	include_once '../conn/mysql.php';
	include '../check.php';
	$num=sql("frow", "qs_list", "id", "where tjr='".$user."' and (zt=3 or zt=8) order by id");
	$page=new Page($num,20);
	$res=sql("s", "qs_list", "*", "where tjr='".$user."'  and (zt=3 or zt=8) order by zt asc,id desc {$page->limit}");
	echo '	  <div class="right_con2"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr bgcolor="#f2f2f2" class="right_con2_top">
                <td width="117" height="43" class="youxia" >结算日期</th><th width="160px"  class="youxia">订单结算</th><th width="160px" class="youxia">异常清算</th><th width="60px" class="youxia">邀请奖励</th><th width="60px" class="youxia">应返款</th><th width="60px" class="youxia">状态</th></tr>
	';
	if($res){
		$k=1;
		foreach ($res as $info){
			if (gv($info,'zt')==3) {
				$color='red';
			}else{
				$color='green';
			}
			if($k%2==1){
				$col="#FFFFFF";
				}else{
					$col="#FFFFCC";
					}
			$res=sql("s", "list", "*", "where tjr='".$user."'  and (zt=3 or zt=6) and tong_ji=0 {$page->limit}");
			echo '<tr bgcolor="'.$col.'">
<td  class="youxia">'.gv($info,'qs_time').'</td>
<td  class="youxia"><a >结算 '.gv($info,'num').' 笔，共'.gv($info,'jg').'元</a></td>
<td  class="youxia">无</td>
<td  class="youxia">无</td>
<td  class="youxia">'.gv($info,'fc').' 元</td>
<td  class="xia"><font color="'.$color.'">'.zt(gv($info,'zt')).'</font></td>
	</tr>';
	$k++;
		}
	}
	
	echo '</table>
	<div class="uc-pager">'.$page->fpage().'</div>';
